package com.mars.foodserver.controller.admin;


import com.mars.foodserver.controller.common.BaseController;
import com.mars.foodserver.request.FoodTypeRequest;
import com.mars.foodserver.request.UserRequest;
import com.mars.foodserver.request.WeixinUserRequest;
import com.mars.foodserver.response.result.R;
import com.mars.foodserver.service.IUserService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * User 控制层
 *
 * @Author wq
 * @Date 2021-03-16
 **/
@RestController
@RequestMapping("admin/user")
@AllArgsConstructor
public class AdminUserController {

    private final IUserService userService;

    /**
     * 分页
     *
     * @param request 请求参数
     * @return R
     */
    @PostMapping("/page")
    private R page(@RequestBody UserRequest request) {
        return R.success(userService.page(request));
    }

    @GetMapping("/updateStatus")
    private R page(Integer userId) {
        userService.updateStatus(userId);
        return R.success();
    }


}